import org.apache.hadoop.hive.ql.exec.UDF;

public class PhoneUdf extends UDF {
    public static String evaluate(String hm){
        if(hm==null || "".equals(hm)){
            return "fasle";
        }
        String regexExpression="(((\\+|00)86)?1((3[\\d])|(4[5,6,7,9])|(5[0-3,5-9])|(6[5-7])|(7[0-8])|(8[\\d])|(9[1,8,9]))\\d{8})|(0\\d{2,3}-\\d{7,8})|(\\d{7,8})";
        boolean matches = hm.matches(regexExpression);
        return matches?"true":"false";
    }
}